chore: Define precedence for deprecated 'auth_tokens' vs. 'auth_headers' #237
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the scenario where a user provides both
auth_tokensandauth_headers, both of which are deprecated arguments.Problem
Previously, if a user provided both
auth_tokensandauth_headers, the authentication tokens fromauth_headerswere prioritized. This created an inconsistent behavior, especially considering thatauth_tokenswas deprecated more recently thanauth_headers.Solution
This change shifts the precedence to
auth_tokens. Now, if bothauth_tokensandauth_headersare present, only the authentication tokens specified inauth_tokenswill be considered.Reasoning
auth_tokenswas deprecated more recently thanauth_headers. Prioritizing the more recently deprecated argument provides a clearer signal to users about the intended deprecation path and guides them towards the recommended, non-deprecated args.auth_token_getters(the current recommended approach) alongside a deprecated argument likeauth_tokens,auth_token_getterstakes precedence and overrides the deprecated argument. This PR extends that "latest argument wins" principle to the deprecated arguments themselves, ensuring consistent behavior.